﻿if (typeof jQuery == 'undefined') {
    cekjq = {};
    cekjq['s'] = document['createElement']('script');
    cekjq['s']['src'] = 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js';
    document['getElementsByTagName']('head')[0]['appendChild'](cekjq['s']);
};
var postTitle = new Array();
var postUrl = new Array();
var postMp3 = new Array();
var postDate = new Array();
var postLabels = new Array();
var postBaru = new Array();
var sortBy = 'titleasc';
var tocLoaded = false;
var numChars = 250;
var postFilter = '';
var numberfeed = 0;

function loadtoc(_0x6c30xd) {
    function _0x6c30xe() {
        if ('entry' in _0x6c30xd['feed']) {
            var _0x6c30xf = _0x6c30xd['feed']['entry']['length'];
            numberfeed = _0x6c30xf;
            ii = 0;
            for (var _0x6c30x10 = 0; _0x6c30x10 < _0x6c30xf; _0x6c30x10++) {
                var _0x6c30x11 = _0x6c30xd['feed']['entry'][_0x6c30x10];
                var _0x6c30x12 = _0x6c30x11['title']['$t'];
                var _0x6c30x13 = _0x6c30x11['published']['$t']['substring'](0, 10);
                var _0x6c30x14;
                for (var _0x6c30x15 = 0; _0x6c30x15 < _0x6c30x11['link']['length']; _0x6c30x15++) {
                    if (_0x6c30x11['link'][_0x6c30x15]['rel'] == 'alternate') {
                        _0x6c30x14 = _0x6c30x11['link'][_0x6c30x15]['href'];
                        break;
                    };
                };
                var _0x6c30x16 = '';
                for (var _0x6c30x15 = 0; _0x6c30x15 < _0x6c30x11['link']['length']; _0x6c30x15++) {
                    if (_0x6c30x11['link'][_0x6c30x15]['rel'] == 'enclosure') {
                        _0x6c30x16 = _0x6c30x11['link'][_0x6c30x15]['href'];
                        break;
                    };
                };
                var _0x6c30x17 = '';
                if ('category' in _0x6c30x11) {
                    for (var _0x6c30x15 = 0; _0x6c30x15 < _0x6c30x11['category']['length']; _0x6c30x15++) {
                        _0x6c30x17 = _0x6c30x11['category'][_0x6c30x15]['term'];
                        var _0x6c30x18 = _0x6c30x17['lastIndexOf'](';');
                        if (_0x6c30x18 != -1) {
                            _0x6c30x17 = _0x6c30x17['substring'](0, _0x6c30x18);
                        };
                        postLabels[ii] = _0x6c30x17;
                        postTitle[ii] = _0x6c30x12;
                        postDate[ii] = _0x6c30x13;
                        postUrl[ii] = _0x6c30x14;
                        postMp3[ii] = _0x6c30x16;
                        if (_0x6c30x10 < 10) {
                            postBaru[ii] = true;
                        } else {
                            postBaru[ii] = false;
                        };
                        ii = ii + 1;
                    };
                };
            };
        };
    };
    _0x6c30xe();
    sortBy = 'titleasc';
    sortPosts(sortBy);
    sortlabel();
    tocLoaded = true;
    displayToc2();
    document['write']('<a href="http://www.tonton.yt/" style="font-size: 8px; text-decoration:none; color: #616469;">Widget by Tonton.yt</a>');
};

function filterPosts(_0x6c30x1a) {
    scroll(0, 0);
    postFilter = _0x6c30x1a;
    displayToc(postFilter);
};

function allPosts() {
    sortlabel();
    postFilter = '';
    displayToc(postFilter);
};

function sortPosts(sortBy) {
    function _0x6c30x1d(_0x6c30x1e, _0x6c30x1f) {
        var _0x6c30x20 = postTitle[_0x6c30x1e];
        postTitle[_0x6c30x1e] = postTitle[_0x6c30x1f];
        postTitle[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postDate[_0x6c30x1e];
        postDate[_0x6c30x1e] = postDate[_0x6c30x1f];
        postDate[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postUrl[_0x6c30x1e];
        postUrl[_0x6c30x1e] = postUrl[_0x6c30x1f];
        postUrl[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postLabels[_0x6c30x1e];
        postLabels[_0x6c30x1e] = postLabels[_0x6c30x1f];
        postLabels[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postMp3[_0x6c30x1e];
        postMp3[_0x6c30x1e] = postMp3[_0x6c30x1f];
        postMp3[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postBaru[_0x6c30x1e];
        postBaru[_0x6c30x1e] = postBaru[_0x6c30x1f];
        postBaru[_0x6c30x1f] = _0x6c30x20;
    };
    for (var _0x6c30x10 = 0; _0x6c30x10 < postTitle['length'] - 1; _0x6c30x10++) {
        for (var _0x6c30x21 = _0x6c30x10 + 1; _0x6c30x21 < postTitle['length']; _0x6c30x21++) {
            if (sortBy == 'titleasc') {
                if (postTitle[_0x6c30x10] > postTitle[_0x6c30x21]) {
                    _0x6c30x1d(_0x6c30x10, _0x6c30x21);
                };
            };
            if (sortBy == 'titledesc') {
                if (postTitle[_0x6c30x10] < postTitle[_0x6c30x21]) {
                    _0x6c30x1d(_0x6c30x10, _0x6c30x21);
                };
            };
            if (sortBy == 'dateoldest') {
                if (postDate[_0x6c30x10] > postDate[_0x6c30x21]) {
                    _0x6c30x1d(_0x6c30x10, _0x6c30x21);
                };
            };
            if (sortBy == 'datenewest') {
                if (postDate[_0x6c30x10] < postDate[_0x6c30x21]) {
                    _0x6c30x1d(_0x6c30x10, _0x6c30x21);
                };
            };
            if (sortBy == 'orderlabel') {
                if (postLabels[_0x6c30x10] > postLabels[_0x6c30x21]) {
                    _0x6c30x1d(_0x6c30x10, _0x6c30x21);
                };
            };
        };
    };
};

function sortlabel() {
    sortBy = 'orderlabel';
    sortPosts(sortBy);
    var _0x6c30x21 = 0;
    var _0x6c30x10 = 0;
    while (_0x6c30x10 < postTitle['length']) {
        temp1 = postLabels[_0x6c30x10];
        firsti = _0x6c30x21;
        do {
            _0x6c30x21 = _0x6c30x21 + 1;
        } while (postLabels[_0x6c30x21] == temp1);;
        _0x6c30x10 = _0x6c30x21;
        sortPosts2(firsti, _0x6c30x21);
        if (_0x6c30x10 > postTitle['length']) {
            break;
        };
    };
};

function sortPosts2(_0x6c30x24, _0x6c30x25) {
    function _0x6c30x26(_0x6c30x1e, _0x6c30x1f) {
        var _0x6c30x20 = postTitle[_0x6c30x1e];
        postTitle[_0x6c30x1e] = postTitle[_0x6c30x1f];
        postTitle[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postDate[_0x6c30x1e];
        postDate[_0x6c30x1e] = postDate[_0x6c30x1f];
        postDate[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postUrl[_0x6c30x1e];
        postUrl[_0x6c30x1e] = postUrl[_0x6c30x1f];
        postUrl[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postLabels[_0x6c30x1e];
        postLabels[_0x6c30x1e] = postLabels[_0x6c30x1f];
        postLabels[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postMp3[_0x6c30x1e];
        postMp3[_0x6c30x1e] = postMp3[_0x6c30x1f];
        postMp3[_0x6c30x1f] = _0x6c30x20;
        var _0x6c30x20 = postBaru[_0x6c30x1e];
        postBaru[_0x6c30x1e] = postBaru[_0x6c30x1f];
        postBaru[_0x6c30x1f] = _0x6c30x20;
    };
    for (var _0x6c30x10 = _0x6c30x24; _0x6c30x10 < _0x6c30x25 - 1; _0x6c30x10++) {
        for (var _0x6c30x21 = _0x6c30x10 + 1; _0x6c30x21 < _0x6c30x25; _0x6c30x21++) {
            if (postTitle[_0x6c30x10] > postTitle[_0x6c30x21]) {
                _0x6c30x26(_0x6c30x10, _0x6c30x21);
            };
        };
    };
};

function displayToc(_0x6c30x1a) {
    var _0x6c30x28 = 0;
    var _0x6c30x29 = '';
    var _0x6c30x2a = 'Judul Artikel';
    var _0x6c30x2b = 'Klik untuk sortir berdasarkan judul';
    var _0x6c30x2c = 'Tanggal';
    var _0x6c30x2d = 'Klik untuk Sortir bedasarkan tanggal';
    var _0x6c30x2e = 'Kategori';
    var _0x6c30x2f = '';
    if (sortBy == 'titleasc') {
        _0x6c30x2b += ' (descending)';
        _0x6c30x2d += ' (newest first)';
    };
    if (sortBy == 'titledesc') {
        _0x6c30x2b += ' (ascending)';
        _0x6c30x2d += ' (newest first)';
    };
    if (sortBy == 'dateoldest') {
        _0x6c30x2b += ' (ascending)';
        _0x6c30x2d += ' (newest first)';
    };
    if (sortBy == 'datenewest') {
        _0x6c30x2b += ' (ascending)';
        _0x6c30x2d += ' (oldest first)';
    };
    if (postFilter != '') {
        _0x6c30x2f = 'Klik untuk menampilkan semua';
    };
    _0x6c30x29 += '<table>';
    _0x6c30x29 += '<tr>';
    _0x6c30x29 += '<td class="toc-header-col1">';
    _0x6c30x29 += '<a href="javascript:toggleTitleSort();" title="' + _0x6c30x2b + '">' + _0x6c30x2a + '</a>';
    _0x6c30x29 += '</td>';
    _0x6c30x29 += '<td class="toc-header-col2">';
    _0x6c30x29 += '<a href="javascript:toggleDateSort();" title="' + _0x6c30x2d + '">' + _0x6c30x2c + '</a>';
    _0x6c30x29 += '</td>';
    _0x6c30x29 += '<td class="toc-header-col3">';
    _0x6c30x29 += '<a href="javascript:allPosts();" title="' + _0x6c30x2f + '">' + _0x6c30x2e + '</a>';
    _0x6c30x29 += '</td>';
    _0x6c30x29 += '<td class="toc-header-col4">';
    _0x6c30x29 += 'Download MP3';
    _0x6c30x29 += '</td>';
    _0x6c30x29 += '</tr>';
    for (var _0x6c30x10 = 0; _0x6c30x10 < postTitle['length']; _0x6c30x10++) {
        if (_0x6c30x1a == '') {
            _0x6c30x29 += '<tr><td class="toc-entry-col1"><a href="' + postUrl[_0x6c30x10] + '">' + postTitle[_0x6c30x10] + '</a></td><td class="toc-entry-col2">' + postDate[_0x6c30x10] + '</td><td class="toc-entry-col3">' + postLabels[_0x6c30x10] + '</td><td class="toc-entry-col4">' + '<a href="' + postMp3[_0x6c30x10] + '">' + 'Download' + '</a>' + '</td></tr>';
            _0x6c30x28++;
        } else {
            z = postLabels[_0x6c30x10]['lastIndexOf'](_0x6c30x1a);
            if (z != -1) {
                _0x6c30x29 += '<tr><td class="toc-entry-col1"><a href="' + postUrl[_0x6c30x10] + '">' + postTitle[_0x6c30x10] + '</a></td><td class="toc-entry-col2">' + postDate[_0x6c30x10] + '</td><td class="toc-entry-col3">' + postLabels[_0x6c30x10] + '</td><td class="toc-entry-col4">' + '<a href="' + postMp3[_0x6c30x10] + '">' + 'Download' + '</a>' + '</td></tr>';
                _0x6c30x28++;
            };
        };
    };
    _0x6c30x29 += '</table>';
    if (_0x6c30x28 == postTitle['length']) {
        var _0x6c30x30 = '<span class="toc-note">Menampilkan Semua ' + postTitle['length'] + ' Artikel<br/></span>';
    } else {
        var _0x6c30x30 = '<span class="toc-note">Menampilkan ' + _0x6c30x28 + ' artikel dengan kategori \'';
        _0x6c30x30 += postFilter + '\' dari ' + postTitle['length'] + ' Total Artikel<br/></span>';
    };
    var _0x6c30x31 = document['getElementById']('toc');
    _0x6c30x31['innerHTML'] = _0x6c30x30 + _0x6c30x29;
};

function displayToc2() {
    var _0x6c30x21 = 0;
    var _0x6c30x10 = 0;
    document['write']('<div id="daftar-isi">');
    while (_0x6c30x10 < postTitle['length']) {
        temp1 = postLabels[_0x6c30x10];
        document['write']('<div class="sublabel">');
        document['write']('<div class="judul-label">' + temp1 + '</div>');
        document['write']('<div class="judul-list"><ol>');
        firsti = _0x6c30x21;
        var _0x6c30x33 = 'odd';
        do {
            if (_0x6c30x33 == 'odd') {
                document['write']('<li class="data-list list-ganjil">');
                _0x6c30x33 = 'even';
            } else {
                document['write']('<li class="data-list list-genap">');
                _0x6c30x33 = 'odd';
            };
            document['write']('<a href="' + postUrl[_0x6c30x21] + '">' + postTitle[_0x6c30x21] + '</a>');
            if (postBaru[_0x6c30x21] == true) {
                document['write'](' - <strong><em><span style="color: rgb(255, 0, 0);">New !!</span> </em></strong>');
            };
            document['write']('</li>');
            _0x6c30x21 = _0x6c30x21 + 1;
        } while (postLabels[_0x6c30x21] == temp1);;
        _0x6c30x10 = _0x6c30x21;
        document['write']('</ol></div></div>');
        sortPosts2(firsti, _0x6c30x21);
        if (_0x6c30x10 > postTitle['length']) {
            break;
        };
    };
    document['write']('</div>');
};

function toggleTitleSort() {
    if (sortBy == 'titleasc') {
        sortBy = 'titledesc';
    } else {
        sortBy = 'titleasc';
    };
    sortPosts(sortBy);
    displayToc(postFilter);
};

function toggleDateSort() {
    if (sortBy == 'datenewest') {
        sortBy = 'dateoldest';
    } else {
        sortBy = 'datenewest';
    };
    sortPosts(sortBy);
    displayToc(postFilter);
};

function showToc() {
    if (tocLoaded) {
        displayToc(postFilter);
        var _0x6c30x37 = document['getElementById']('toclink');
    } else {
        alert('Just wait... TOC is loading');
    };
};

function hideToc() {
    var _0x6c30x31 = document['getElementById']('toc');
    _0x6c30x31['innerHTML'] = '';
    var _0x6c30x37 = document['getElementById']('toclink');
    _0x6c30x37['innerHTML'] = '<a href="#" onclick="scroll(0,0); showToc(); Effect.toggle(' + '\'toc-result\',\'blind\');' + '">\xA1\xED Menampilkan Daftar Isi</a> <img src="http://radiorodja.googlepages.com/new_1.gif"/>';
};

function looptemp2() {
    for (var _0x6c30x10 = 0; _0x6c30x10 < numberfeed; _0x6c30x10++) {
        document['write']('<br>');
        document['write']('Post Link\x09\x09  : ' + '<a href="' + postUrl[_0x6c30x10] + '">' + postTitle[_0x6c30x10] + '</a>' + '<br>');
        document['write']('Download mp3  : ' + '<a href="' + postMp3[_0x6c30x10] + '">' + postTitle[_0x6c30x10] + '</a>' + '<br>');
        document['write']('<br>');
    };
};